package second.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
//filter拦截路径写法
//  精确拦截 /hello.jsp
//  后缀拦截 *.jsp
//  通配符拦截 /* 拦截所有的资源

@WebFilter(value = "/*")
public class Filter2 implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        System.out.println("myfilter2过滤之前.......");
        chain.doFilter(req, resp);
        System.out.println("myfilter2过滤之后");
    }

    public void init(FilterConfig config) throws ServletException {

    }

}
